//
//  HLJTalkHotAnotherCell.m
//  B段项目
//
//  Created by 111111 on 15/12/25.
//  Copyright © 2015年 张智超. All rights reserved.
//

#import "HLJTalkHotAnotherCell.h"

@implementation HLJTalkHotAnotherCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews{
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];

    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.mas_equalTo( 50);
        // 添加左、上边距约束（左、上约束都是20）
        make.left.and.top.mas_equalTo(30);
        make.right.mas_equalTo(- 30);
        
    }];
  //  self.titleLabel.backgroundColor = [UIColor greenColor];
    self.titleLabel.font = [UIFont boldSystemFontOfSize:WIDTH/18];
    self.titleLabel.numberOfLines = 0;
    [self.contentView addSubview:self.titleLabel];
    
    
    
    self.contentLabel = [[UILabel alloc]init ];
    
    [self.contentView addSubview:self.contentLabel];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.mas_equalTo( 80);
        // 添加左、上边距约束（左、上约束都是20）
        make.left.mas_equalTo(30);
        make.right.mas_equalTo(- 30);
        make.top.mas_equalTo(90);
        
    }];

    
    self.contentLabel.font = [UIFont systemFontOfSize:17];
    [self.contentLabel setTextColor:[UIColor colorWithRed:0.49 green:0.49 blue:0.49 alpha:1]];
    //    //调节高度
    self.contentLabel.numberOfLines = 3;
    self.contentLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    

    
    self.timeLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.timeLabel];

    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.size.mas_equalTo( CGSizeMake(120, 20));
        // 添加左、上边距约束（左、上约束都是20）
        make.left.mas_equalTo(30);
       
        make.bottom.mas_equalTo(-20);
        
    }];

    
    self.timeLabel.font = [UIFont systemFontOfSize:WIDTH/30];
    self.timeLabel.textColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1];
    
    
    
    
    
    self.comImageView = [[UIImageView alloc] init];
    
     [self.contentView addSubview:self.comImageView];
    [self.comImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.size. mas_equalTo(CGSizeMake(30, 30));
        // 添加左、上边距约束（左、上约束都是20）
        make.bottom.mas_equalTo(-20);
        
        make.right.mas_equalTo(- 75);
        
        
        
    }];

    self.comImageView.image = [UIImage imageNamed:@"iconfont-hot-2.png"];
   
    
    
    
    
    self.commentLabel = [[UILabel alloc] init];
    
    [self.contentView addSubview:self.commentLabel];
    [self.commentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.size.mas_equalTo(CGSizeMake(50, 20));
        // 添加左、上边距约束（左、上约束都是20）
        make.bottom.mas_equalTo(-20);
        
        make.right.mas_equalTo(- 10);
        
        
        
    }];
    
    self.commentLabel.font = [UIFont systemFontOfSize:WIDTH/30];
    self.commentLabel.textColor =[UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1];
    
    
    
    
}




-(void)setTalkAnotherModel:(HLJTalkHotModel *)talkAnotherModel{
    _talkAnotherModel = talkAnotherModel;
    self.titleLabel.text = self.talkAnotherModel.title;
    self.contentLabel.text = self.talkAnotherModel.content;
    
    self.timeLabel.text = self.talkAnotherModel.addtime_f;
    NSString *count = [NSString stringWithFormat:@"%@", [self.talkAnotherModel.counterList valueForKey:@"comment"]];
    self.commentLabel.text = count;
    
 
}




@end
